package projectiles
{
	import org.flixel.*;
	
	import enemies.*;
	
	/**
	 * ...
	 * @author JAC
	 */
	public class Rock extends Projectile
	{
		public function Rock(i:uint = 0, j:uint = 0)
		{
			super(i, j);
			
			loadGraphic(Assets.ImgPlayerBoulder, true, false, 25, 25);
			
			addAnimation("UP", [8, 10, 9], 6);
			addAnimation("DOWN", [8, 9, 10], 6);
			addAnimation("LEFT", [0, 1, 2, 3, 4, 5, 6, 7], 6);
			addAnimation("RIGHT", [0, 7, 6, 5, 4, 3, 2, 1], 6);
			addAnimation("DYING", [11, 12, 13, 14, 15], 6, false);
			play("DOWN");
			
			_speed = 250;
		}
		
		override public function overlapWithEnemy(e:Enemy):void
		{
			e.kill();
			e.stopMoving();
			kill();
			stopMoving();
			FlxG.play(Assets.SndPunch, Registry.soundVolume);
		}
		
		override public function kill():void
		{
			FlxG.play(Assets.SndRockThrow, Registry.soundVolume);
			super.kill();
		}
	}
}